<!-- The view to create/edit a medicine default usage -->
  
<br />
<form id="add_med_def_usage_form" name="add_med_def_usage_form">
<input type="hidden" id="med_def_usage_id" name="med_def_usage_id" value="{$medDefUsage->get_id()}">
<div class="form_container" style="width: 680px;">
    <div>
        <span id="status_message" style="font-style: italic; color: red;"></span>
    </div>
    <table cellspacing="0" cellpadding="0">
        <tr>
            <td colspan="4" class="field" style="text-transform: uppercase">{translate}Usage detail{/translate}</td>
        </tr>
        <!-- Usage_title -->
        <tr>
            <td class="label">{translate}Usage name{/translate}</td>
            <td colspan="3" class="field">
                <input id="usage_title" name="usage_title" type="text" size="65" 
                    value="{$medDefUsage->get('usage_title')}">
            </td>                                
        </tr>
        <!-- Usage_num & usage_unit -->
        <tr>
            <td class="label">{translate}Usage{/translate}</td>
            <td class="field">
                <input id="usage_num" name="usage_num" type="text" value="{$medDefUsage->get('usage_num')}"
                    onkeyup="javascript:this.value=this.value.replace(/[^0-9]/g, '');">
            </td>
            <td class="field">
                <input id="usage_unit" name="usage_unit" type="text"  
                    value="{$medDefUsage->get('usage_unit')}">
            </td>
            <td class="label">/{translate}Times{/translate}</td>
        </tr>
        <!-- Dosage -->
        <tr>
            <td class="label">{translate}Dosage{/translate}</td>
            <td class="field">
                <input id="dosage" name="dosage" type="text" value="{$medDefUsage->get('dosage')}" 
                    onkeyup="javascript:this.value=this.value.replace(/[^0-9]/g, '');"> 
            </td>
            <td colspan="2" class="label">{translate}times/day{/translate}</td>
        </tr>
        <!-- Time -->
        <tr>
            <td class="label">{translate}Time{/translate}</td>
            <td class="field">
                <input id="time" name="time" type="text" value="{$medDefUsage->get('time')}"
                    onkeyup="javascript:this.value=this.value.replace(/[^0-9]/g, '');">
            </td>
            <td colspan="2" class="label">{translate}day(s){/translate}</td>
        </tr>
        <!-- Quantity -->
        <tr>
            <td class="label">{translate}Quantity{/translate}</td>
            <td class="field">
                <input id="quantity_num" name="quantity_num" type="text"
                    value="{$medDefUsage->get('quantity_num')}" 
                    onkeyup="javascript:this.value=this.value.replace(/[^0-9]/g, '');">
            </td>
            <td colspan="2" class="field">
                <input id="quantity_title" name="quantity_title" type="text"  
                    value="{$medDefUsage->get('quantity_title')}">
            </td>
        </tr>
        
    </table>
    
</div>

<div align="right" style="padding-top: 10px; width: 700px;">
    <div id="btn_save">
        <a id="button_save" class="button_link" href="javascript:saveMedicineDefUsage();">
            {if $medDefUsage->get_id() > 0}
                {translate}Save{/translate}                  
            {else}
                {translate}Add new usage{/translate}
            {/if}
        </a>
    </div>
    <div id="barLoading" style="display:none;">
        <img src="{$base_uri}images/ajax-loader.gif"/>
    </div>
</div>
</form>